﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms.Design;
using System.Reflection;
using System.ComponentModel.Design;
using System.Collections;

namespace ProgNetComponentsDx.Controls.Design.Designers
{
    internal class PositionControlDesigner : ParentControlDesigner
    {
        private PositionControl PositionControl
        {
            get { return Control as PositionControl; }
        }
        public override void Initialize(System.ComponentModel.IComponent component)
        {
            base.Initialize(component);

            if (PositionControl != null)
            {
                foreach (System.Windows.Forms.Control c in PositionControl.Controls)
                {
                    EnableDesignMode(c, c.Name);
                }
            }
        }
        public class PositionControlButtonDesigner : ControlDesigner
        {
            private PositionControlButton Button
            {
                get { return Control as PositionControlButton; }
            }
            private PositionControl PositionControl
            {
                get { return Button.PositionControl; }
            }
            
            public override bool CanBeParentedTo(IDesigner parentDesigner)
            {
                return parentDesigner.Component == PositionControl;
                //return base.CanBeParentedTo(parentDesigner);
            }
            protected override void PreFilterProperties(IDictionary properties)
            {
                base.PreFilterProperties(properties);

                properties.Remove("Dock");
                properties.Remove("Name");
            }
        }

    }
}
